﻿using System;
using UnityEngine;

// Token: 0x020002B5 RID: 693
public class FloatStored
{
	// Token: 0x06000FF0 RID: 4080 RVA: 0x000757D9 File Offset: 0x000739D9
	public FloatStored(string key, float defaultValue)
	{
		this.key = key;
		this.val = this.GetFloatValue(key, defaultValue);
	}

	// Token: 0x1700025C RID: 604
	// (get) Token: 0x06000FF1 RID: 4081 RVA: 0x000757F6 File Offset: 0x000739F6
	// (set) Token: 0x06000FF2 RID: 4082 RVA: 0x000757FE File Offset: 0x000739FE
	public float value
	{
		get
		{
			return this.val;
		}
		set
		{
			this.val = value;
			this.SaveFloatValue(this.key, value);
		}
	}

	// Token: 0x06000FF3 RID: 4083 RVA: 0x00075814 File Offset: 0x00073A14
	private float GetFloatValue(string key, float defaultValue)
	{
		if (PlayerPrefs.HasKey(key))
		{
			return PlayerPrefs.GetFloat(key);
		}
		return defaultValue;
	}

	// Token: 0x06000FF4 RID: 4084 RVA: 0x00075836 File Offset: 0x00073A36
	private void SaveFloatValue(string key, float newValue)
	{
		PlayerPrefs.SetFloat(key, newValue);
	}

	// Token: 0x040014DB RID: 5339
	private string key;

	// Token: 0x040014DC RID: 5340
	private float val;
}
